﻿using KendoMvcUI.UI.Grid;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace KendoMvcUI.Core
{
    public class KendoUIBase:MVCUIBase
    {
        public KendoUIBase(KendoUIControlSettings settings,ViewContext context,IViewDataContainer viewDataContainer)
            :base(settings,context,viewDataContainer)
        { }
        public override string RenderJavascript()
        {
            KendoUIControlSettings settings=(KendoUIControlSettings)Settings;
            var script= base.RenderJavascript();
            var jquery = @"<script>$(function(){$('#"+Settings.Id+"')."+settings.KendoUIFunctionName+"("+script+")});</script>";

            return jquery+RenderHtml();
        }
        public virtual string RenderHtml()
        {
            return "";
        }
    }
}
